import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryTable(data) {
  return http.request<HttpResult>("get", "/admin/resource/get/table", {
    params: data
  });
}

export function queryList(data) {
  return http.request<HttpResult>("get", "/admin/resource/get/list", {
    params: data
  });
}

export function addObj(data) {
  return http.request<HttpResult>("post", "/admin/resource/insert", {
    data: data
  });
}

export function updateObj(data) {
  return http.request<HttpResult>("post", "/admin/resource/update", {
    data: data
  });
}

export function deleteObjs(ids) {
  return http.request<HttpResult>("post", `/admin/resource/delete/${ids}`);
}
